#include "../../include/helpers/worker_thread.h"
#include "../../include/helpers/thread_state_pls.h"
#include <memory>

namespace ohos_rive {
std::unique_ptr<DrawableThreadState> WorkerThread::MakeThreadState(const RendererType type)
{
    LOGI("WorkerThread::MakeThreadState creating thread state for renderer type: %{public}d", static_cast<int>(type));

    switch (type) {
        case RendererType::Canvas:
            LOGI("Creating CanvasThreadState for OHOS");
            return std::make_unique<CanvasThreadState>();

        case RendererType::Rive:
            LOGI("Creating PLSThreadState for OHOS");
            return std::make_unique<PLSThreadState>();

        default:
            LOGE("Unknown renderer type: %d, defaulting to PLSThreadState", static_cast<int>(type));
            return std::make_unique<PLSThreadState>();
    }
}
} // namespace ohos_rive